QuickTime 3 Reference

| Previous | Chapter contents | Chapter top | Section top |

Creating a 16-bit, 22K Uncompressed WAVE File Using QuickTime 3

The following is an example of how you can convert an 8-bit, 22K .wav file to a 16-bit, 22K IMAPCM .wav file using QuickTime 3.

While QuickTime can create Wave files, it does not support creating IMA compressed Wave files. It can play back Wave files that contain IMA compressed audio.

To create a 16-bit 22k uncompressed Wave file using QuickTime 3, you perform the following steps:

  1. Open an exporter.
ComponentInstance ci;

ci = OpenDefaultComponent(MovieExportType, kQTFileTypeWave);
  1. Create a sound description for the audio format you want. If there are values you don't care about, you can leave them unspecified. In this example, the number of channels is not indicated. The exporter will base the channel count on the source movie.
SoundDescriptionHandle desc;

desc = (SoundDescriptionHandle )NewHandleClear(sizeof(SoundDescripion));
(**desc).descSize = sizeof(SoundDescription);
(**desc).sampleSize = 16;
(**desc).sampleRate = 22050L << 16;
(**desc).dataFormat = k16BitLittleEndianFormat;
  1. Specify the export component in which format you want the audio.
MovieExportSetSampleDescription(ci, (SampleDescriptionHandle)desc,
SoundMediaType);
  1. Perform the export operation.
ConvertMovieToFile(theMovie, nil, &outputFile, kQTFileTypeWave,
OSTypeConst('TVOD'),
-1, nil, 0, ci);
  1. After you have finished, dispose everything that you have created.
CloseComponent(ci);
DisposeHandle((Handle)desc);

 


© 1997 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Section top |